//=============================================================================
// 文件名:   main.js
// 创建人:   han.zw
// 创建日期:   2016-04-15
// @:  hanangjie@163.com

$.prototype.serializeObject=function(){
    var obj=new Object();
    $.each(this.serializeArray(),function(index,param){
        if(!(param.name in obj)){
            obj[param.name]=param.value;
        }
    });
    return obj;
};
Object.prototype.toParams=function(){
    var html="";
    var obj=this;
    for(var x in obj){
        if(x!="toParams"){
            html+="&"+x+"="+obj[x];
        }
    }
    return html.slice(1);
}
module.exports = {
    // domain:"http://112.124.9.65:8081/LabHomeAdmin/",
     domain:"http:///120.26.67.221:8081/LabHomeAdmin/",
     GetQueryString: function (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)return r[2];
        return "";
    },
    GetQueryObject: function () {
        var r = window.location.search.substr(1);
        var arr = r.split("&");
        var obj = {};
        for (var i = 0; i < arr.length; i++) {
            obj[arr[i].split("=")[0]] = arr[i].split("=")[1];
        }
        return obj;
    },

    loading: function () {
       $(".loading").show()
    },
    loadingClose: function () {
        $(".loading").hide();
    }
};
